Rules and Applications of Derivatives
Bren Calculus Workshop
Nathaniel Grimes
Bren School of Environmental Science & Management
Last updated: Sep 17, 2024
Team Review
How did everyone feel about the problem set?
Any questions?
Discuss with Team
Rules for Derivatives Continued
Product Rule
\[ \large \frac{d}{dx}=[f(x)*g(x)]=f(x)g'(x)+g(x)f'(x) \]
Breakdown multiplication into two separate functions
Then take the first function times the derivative of the second, and add the second function times the derivative of the first.
Product Rule Example
\[ \begin{align} y&=2x(x^2+3x) \\ y&=\overbrace{2x}^{f(x)}\overbrace{(x^2+3x)}^{g(x)} &\text{Break into two functions} \\ \frac{dy}{dx}&=\overbrace{2x}^{f(x)}\overbrace{(2x+3)}^{g'(x)}+\overbrace{2}^{f'(x)}\overbrace{(x^2+3x)}^{g(x)} &\text{Apply Power Rule} \\ \frac{dy}{dx}&=6x^2+12x &\text{Algebra clean up} \end{align} \]
Rule for Derivatives Continued
Quotient Rule
\[ \large \frac{d}{dx}\left [\frac{f(x)}{g(x)}\right]=\frac{g(x)f'(x)-f(x)g'(x)}{[g(x)]^2} \]
Same idea as product rule, but order matters
The denominator has to be \(g(x)\)
Quotient Rule Example
\[ \begin{align} y&=\frac{x^2}{(x+1)} \\[3px] y&=\class{fragment}{{}\frac{\overbrace{x^2}^{f(x)}}{\underbrace{(x+1)}_{g(x)}}} &\text{Identify Functions}\\[3px] \frac{dy}{dx}&=\class{fragment}{{}\frac{\overbrace{(x+1)}^{g(x)}\overbrace{2x}^{f'(x)}-\overbrace{x^2}^{f(x)}\overbrace{(1)}^{g'(x)}}{\underbrace{(x+1)^2}_{[g(x)]^2}}} &\text{Quotient Rule}\\[3px] \frac{dy}{dx}&=\class{fragment}{{}\frac{x^2+2x}{(x+1)^2}} \end{align} \]
Note: Algebraically solving Quotient Rules can be very challenging. Try to reduce it down to a usable form.
Rule of Derivatives Continued
Chain Rule
\[ \large \frac{d}{dx}[f(g(x))]=f'(g(x))g'(x) \]
Take the derivative of the outermost function then multiply by the derivative of the innermost
Probably the most important rule for advanced calculus
Chain Rule Example
Use a trick called u-substitution
Label the inner function as u
Take the derivative with respect to u
\[ \begin{align} y&\class{fragment}{{}=(x^3-2)^2}\\[3px] u&=\class{fragment}{{}x^3-2}\\[3px] y&\class{fragment}{{}=u^2} \\[3px] \frac{dy}{dx}&=\class{fragment}{{}\frac{dy}{du}\cdot\frac{du}{dx}} \end{align} \]
Chain Rule Example Continued
\[ \begin{align} \frac{dy}{dx}&=\frac{dy}{du}\cdot\frac{du}{dx}\\[3px] \frac{dy}{du}&=\class{fragment}{{}2u} &\text{Reminder: }y=u^2 \\[3px] \frac{du}{dx}&=\class{fragment}{{}3x^2} &\text{Reminder: }u=(x^3-2) \\[3px] \frac{dy}{dx}&=\class{fragment}{{} 2u\cdot3x^2} \\[3px] \frac{dy}{dx}&=\class{fragment}{{} 2(x^3-2)(3x^2)} \end{align} \]
An aside on exponents
Base \(e\) exponents are unique and useful in many math applications
Originally derived to solve compounding interest rate problems in 1683 by Bernoulli
It’s a constant \(e\approx2.72\)
Comes from this limit:
\[ \lim_{n\to \infty}(1+\frac{1}{n})^n \]
Follows normal power properties
\(e^{x+y}=e^x\cdot e^y\)
\(e^{-x}=\frac{1}{e^x}\)
\(e^{x-y}=\frac{e^x}{e^y}\)
\(e^{rx}=(e^x)^r\)
Derivatives of Exponents
\[ \large \frac{d}{dx}e^x=e^x \]
The derivative at every point on this line is simply \(f(x)\)
When \(x=0\), \(\frac{d}{dx(0)}=1\)
Derivatives of Exponents
Higher Order Derivatives
We can continue to take derivatives of derivatives
The second derivative becomes the rate of change of the rate of change (Think acceleration)
Notation:
\(f''(x)\) or \(\frac{d^2y}{dx^2}\): 2nd Derivative
\(f^{(n)}(x)\) or \(\frac{d^ny}{dx^n}\) nth derivative
Identify which rule works best for each function
\[ \begin{align} \text{A) }y=e^{\sqrt{3x+10}} & &\text{B) }g(y)=\frac{(8y+2)}{(4y+3)^3} & & \text{C) }p(b)=18b\cdot e^{2b} \end{align} \]
Assessment continues on next slide
\[ f(x)=(2x-x^2)^3 \]
\[ f(x)=\frac{2}{x^2+1} \]
\[ f(x)=x^2(2x+1) \]
Exponential Functions in the world
Logistic Growth
Resource limits do exist in the world
\[ \begin{align} \frac{dN}{dt}&=rN\left(\frac{K-N}{K}\right) \\ \text{Where }N=\text{population, }r=\text{growth rate, }&t=\text{time, and }K=\text{Carrying Capacity} \end{align} \]
Extremely important in Fisheries and Biological Conservation
Application of derivatives allows us to find crucial information to solve environmental problems
Find instantaneous rate of change at any point
Find when functions are increasing or decreasing
Find the Optimal values of functions
How quickly is the human population rising right now?
Dochy et al. (1995) used the following function to describe the increase in human population over time:
\[ x(t)=\frac{1}{c-\beta t} \]
Where \(c=9.833*10^{-3}\), \(\beta=4.849*10^{-6}\), and \(x\) is the total human population in millions at year \(t\).
How quickly was the human population increasing in 1450?
What should be the population growth rate in 2024 according to this model?
Begin by taking the derivative
First, think of which rules we would use for \(x(t)=\frac{1}{c-\beta t}\)
Begin by taking the derivative
\[ \begin{align} x(t)&=\frac{1}{c-\beta t} \\ x(t)&=(c-\beta t)^{-1} &\text{Rearrange} \\ \frac{dx}{dt}&=\beta(c-\beta t)^{-2} &\text{Chain and Power Rule}\\ x'(1450)&=.61 \text{ million per year} &x'(2024)=13,980 \text{ million per year} \end{align} \]
Why is this model so wrong
The model isn’t wrong, just not predictive out of sample
Derivatives help us understand the behavior of functions and also people
Useful in designing predictive theory for new policies
Personal Example: Will a fishery insurance program incentivize overfishing?
\[ \begin{align} \begin{bmatrix}\frac{\partial K}{\partial \gamma} \\ \frac{\partial L}{\partial \gamma}\end{bmatrix} =-\begin{bmatrix} \frac{\partial U}{\partial K \partial K} & \frac{\partial U}{\partial K \partial L} \\ \frac{\partial U}{\partial L \partial K} & \frac{\partial U}{\partial L \partial L}\end{bmatrix}^{-1}\begin{bmatrix}\frac{\partial U}{\partial K \partial \gamma}\\ \frac{\partial U}{\partial L \partial \gamma}\end{bmatrix} \end{align} \]
\[ \begin{align} \begin{bmatrix}\frac{\partial K}{\partial \gamma} \\ \frac{\partial L}{\partial \gamma}\end{bmatrix}\lesseqgtr 0 \end{align} \]
Let’s start a little simpler
Definition of increasing and decreasing Intervals of a Function
For the function \(f(x)\) (differentiable on the interval \((a,b)\))
If \(f'(x)>0\) for all \(x\) values between \(a\) and \(b\), this interval is increasing
If \(f'(x)<0\) for all \(x\) values betwen \(a\) and \(b\), this interval is said to be decreasing
If \(f'(x)=0\) for all values between \(a\) and \(b\), then the function is constant within the interval
Graphical demonstration of increasing vs decreasing
Optimization problems find relative extremum (aka max or min) of functions
Whether an extremum is a maximum or minimum requires us to test if it is increasing or decreasing at the extremum
\(f(x^*)\) is a local maximum if \(f''(x)<0\)
\(f(x^*)\) is a local minimum if \(f''(x)>0\)
Graphical Example of Optimization
\(f(x)=x^3-12x+2\)
Where does \(f'(x)=0\)?
Solve Analytically
First Order Conditions:
\[ \begin{align} f(x)&=x^3-12x+2 \\ f'(x)&=3x^2-12 \\ x^*&=-2 & x^*=2 \end{align} \]
Second Order Conditions:
\[ \begin{align} f''(x)&=6x \\ f''(-2)&<0 &f''(2)>0 \end{align} \]
By the first order conditions we know that \(x=2\) and \(x=-2\) are local optimum.
The second order conditions inform us that \(x=-2\) is a local maximum and \(x=2\) is a local minimum.
\[ f(x)=2x^3-6x^2+3x+15 \]
Find the optimal amount of interventions dollars to spend for each policy. Consider both costs and benefits. [hint: Remember \(\sqrt{}\) is just \(x^{\frac{1}{2}}\). You can use exponent rules to help solve]
Which policy provides the most benefits?
Which policy is cheaper?
Which policy should the city of Santa Barbara pursue?